import 'package:flutter/material.dart';
import 'package:get/get.dart';

import '../../common.dart';

class ExchangeDetails extends StatefulWidget {
  ExchangeDetails({super.key});
  @override
  State<ExchangeDetails> createState() => _QGRulePageState();
}

class _QGRulePageState extends State<ExchangeDetails> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
        appBar: AppBar(
          backgroundColor: Color(0XFFFFFFFF),
          centerTitle: true,
          leading: buildBackButton(context),
        ),
        bottomNavigationBar: Container(
          height: 50,
          padding: EdgeInsets.symmetric(horizontal: 25),
          margin: EdgeInsets.symmetric(horizontal: 15,vertical: 15),
          decoration: BoxDecoration(
              borderRadius: BorderRadius.circular(50),
              gradient: LinearGradient(
                colors: [Color(0XFF04B8FF),Color(0XFF0075E8)],
                begin: Alignment.topLeft,
                end: Alignment.bottomRight,
              ),
            ),
            child: Row(
                  mainAxisAlignment: MainAxisAlignment.spaceBetween,
                  children: [
                     Text.rich(
                        TextSpan(
                          children: [
                            TextSpan(
                              text: 'ST',
                              style: TextStyle(fontSize: 18.0,color: Color(0XFFFFFFFF)),
                            ),
                            TextSpan(
                              text: '99.00',
                              style: TextStyle(fontSize: 18.0,color: Color(0XFFFFFFFF),fontWeight: FontWeight.bold),
                            ),
                          ],
                        ),
                      ),
                      GestureDetector(
                        onTap: (){
                          Get.dialog(
                            AlertDialog(
                              backgroundColor: Colors.transparent,
                              content: Container(
                                width: 260,
                                height: 230,
                                decoration: BoxDecoration(
                                  color: Color(0XFFFFFFFF),
                                  borderRadius: BorderRadius.circular(20)
                                ),
                                child: Column(
                                  crossAxisAlignment: CrossAxisAlignment.center,
                                  mainAxisAlignment: MainAxisAlignment.center,
                                  children: [
                                    wText(text: '确认回收',size: 20,bold: true),
                                    SizedBox(height: 15,),
                                    Row(
                                      mainAxisAlignment: MainAxisAlignment.center,
                                      children: [
                                       wText(text: '兑换后，指定藏品',size: 18),
                                       wText(text: '将销毁',size: 18,color: '6828FF'),
                                      ],
                                    ),
                                    wText(text: '此操作不可逆',size: 18),
                                    SizedBox(height: 30,),
                                    Row(
                                      mainAxisAlignment: MainAxisAlignment.center,
                                      children: [
                                        GestureDetector(
                                          onTap: (){
                                            Get.back();
                                          },
                                          child: Container(
                                          width: 100,
                                          height: 40,
                                          alignment: Alignment.center,
                                          decoration: BoxDecoration(
                                            color: Color(0XFFEDEDED),
                                            borderRadius: BorderRadius.circular(10)
                                          ),
                                          child: wText(text: '取消',size: 16),
                                        ),
                                        )
                                        ,
                                        SizedBox(width: 10,),
                                        GestureDetector(
                                          onTap: (){
                                            toNamed('/home/exchange/backsuu');
                                          },
                                          child: Container(
                                          width: 100,
                                          height: 40,
                                          alignment: Alignment.center,
                                          decoration: BoxDecoration(
                                            color: Color(0XFFEDEDED),
                                            borderRadius: BorderRadius.circular(10),
                                             gradient: LinearGradient(
                                            colors: [Color(0XFF04B8FF),Color(0XFF0075E8)],
                                            begin: Alignment.topLeft,
                                            end: Alignment.bottomRight,
                                          ),
                                          ),
                                          child: wText(text: '确认',size: 16,color: 'FFFFFF'),
                                        ),
                                        )
                                        ,
                                      ],
                                    )

                                  ],
                                ),
                              ),
                            ),
                          );
                        },
                        child:  wText(text: '立即回收',color: 'FFFFFF',size: 18,bold: true),
                      )
                   ,
                  ],
                ),
        ),
        body:ListView(
            children: [
              wImage(url: 'aaa'),
              Padding(padding: EdgeInsets.symmetric(horizontal: 15,vertical: 15),
              child: Column(
                crossAxisAlignment: CrossAxisAlignment.start,
                children: [
                  Row(
                    mainAxisAlignment: MainAxisAlignment.spaceBetween,
                    children: [
                      Container(
                        width: 200,
                        child: wText(text: '藏品名称二十个字藏品名称二十个字藏品名称',bold: true,size: 18),
                      ),
                      Column(
                        mainAxisAlignment: MainAxisAlignment.end,
                        children: [
                          wText(text: '回收价(ST)',color: '999999'),
                          SizedBox(height: 5,),
                          wText(text: '23549.21',color: 'B10000',size: 18,bold: true),
                        ],
                      )
                    ],
                  ),
                  SizedBox(height: 30,),
                  Row(
                    children: [
                     Expanded(child: 
                      Column(
                        crossAxisAlignment: CrossAxisAlignment.start,
                        children: [
                          wText(text: '版权所有',color: '999999'),
                          SizedBox(height: 5,),
                          wText(text: 'Opensea Gathering',bold: true),
                        ],
                      )
                     ),
                      Expanded(child: 
                      Column(
                        crossAxisAlignment: CrossAxisAlignment.start,
                        children: [
                          wText(text: '发行单位',color: '999999'),
                          SizedBox(height: 5,),
                          wText(text: 'Opensea Gathering',bold: true),
                        ],
                      )
                     )
                    
                    ],
                  ),
                  SizedBox(height: 30,),
                  Row(
                    children: [
                     Expanded(child: 
                      Column(
                        crossAxisAlignment: CrossAxisAlignment.start,
                        children: [
                          wText(text: '首发价格',color: '999999'),
                          SizedBox(height: 5,),
                          wText(text: 'Opensea Gathering',bold: true),
                        ],
                      )
                     ),
                      Expanded(child: 
                      Column(
                        crossAxisAlignment: CrossAxisAlignment.start,
                        children: [
                          wText(text: '当前价格',color: '999999'),
                          SizedBox(height: 5,),
                          wText(text: 'Opensea Gathering',bold: true),
                        ],
                      )
                     )
                    
                    ],
                  ),
                  SizedBox(height: 30,),
                  Row(
                    children: [
                     Expanded(child: 
                      Column(
                        crossAxisAlignment: CrossAxisAlignment.start,
                        children: [
                          wText(text: '藏品价值',color: '999999'),
                          SizedBox(height: 5,),
                          wText(text: 'Opensea Gathering',bold: true),
                        ],
                      )
                     ),
                      Expanded(child: 
                      Column(
                        crossAxisAlignment: CrossAxisAlignment.start,
                        children: [
                          wText(text: '发行总量(份)',color: '999999'),
                          SizedBox(height: 5,),
                          wText(text: 'Opensea Gathering',bold: true),
                        ],
                      )
                     )
                    
                    ],
                  ),
                  SizedBox(height: 30,),
                  Row(
                    children: [
                     Expanded(child: 
                      Column(
                        crossAxisAlignment: CrossAxisAlignment.start,
                        children: [
                          wText(text: '发售时间',color: '999999'),
                          SizedBox(height: 5,),
                          wText(text: 'Opensea Gathering',bold: true),
                        ],
                      )
                     ),
                      Expanded(child: 
                      Column(
                        crossAxisAlignment: CrossAxisAlignment.start,
                        children: [
                          wText(text: '所属链网络',color: '999999'),
                          SizedBox(height: 5,),
                          wText(text: '草田链',bold: true),
                        ],
                      )
                     )
                    ],
                  ),
                  SizedBox(height: 30,),
                  Row(
                    children: [
                     Expanded(child: 
                      Column(
                        crossAxisAlignment: CrossAxisAlignment.start,
                        children: [
                          wText(text: '合约地址',color: '999999'),
                          SizedBox(height: 5,),
                          Row(
                            children: [
                          wText(text: 'OX2323...5432',bold: true),
                          SizedBox(width: 5,),
                          wImage(url: 'copy',width: 12)
                            ],
                          )
                        ],
                      )
                     ),
                      Expanded(child: 
                      Column(
                        crossAxisAlignment: CrossAxisAlignment.start,
                        children: [
                        ],
                      )
                     )
                    ],
                  ),
                  SizedBox(height: 30,),
                  wText(text: '回收须知',size: 16,bold: true),
                  SizedBox(height: 5,),
                  wText(text: '为拓展用户数字提货券的灵活使用场景，平台开放技术接入端口，支持经平台审核的第三方独立服务机构提供提货券定向回收服务。 \n该第三方服务方拥有对每期或每日提货券回收数量的自主设定权与动态调整权，并对相关规则拥有最终解释权。 \n用户如暂不选择商品兑换，可自愿将所持数字提货券转交至服务方进行定向兑付。兑付比例一般不低于券面价值的60%-70%。 \n请用户在使用前充分了解服务方规则，自主决策并承担相应的操作后果与风险责任。',size: 14,height: 1.8)

                ],
              ),
              )
            ],
          )
        );
  }

  
}
